package com.zhangtai.modules.service.certificate;


import com.zhangtai.modules.entity.certificate.CertificateEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-11-10 09:21:29
 */

public interface CertificateService {

    @GetMapping("/findCertificateList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<CertificateEntity> getCertificateList(@RequestParam(value = "code", required = false) String code,
                                                     @RequestParam(value = "name", required = false) String name,
                                                     @RequestParam(value = "unitId", required = false) List<Long> unitId,
                                                     @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                                     @RequestParam(value = "jobId", required = false) List<Long> jobId,
                                                     @RequestParam(value = "startDate", required = false) String startDate,
                                                     @RequestParam(value = "endDate", required = false) String endDate,
                                                     @RequestParam(value = "modelId", required = false) Long modelId,
                                                     @RequestParam(value = "status", required = false) List<Integer> status,
                                                     @RequestParam(value = "oid", required = false) Long oid,
                                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                     @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    List<CertificateEntity> getCertificateUnCallBack();
    @GetMapping("/infoCertificate")
    @ApiOperation(value = "根据id查找")
    CertificateEntity getByIdE(@RequestParam("id") Long id);

    CertificateEntity getByEsignId(Integer id);

    @PostMapping("/saveCertificate")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody CertificateEntity entity);

    @PostMapping("/updateCertificate")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody CertificateEntity entity);

    @GetMapping("/deleteOneCertificate")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteCertificates")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

